import { patchTemplate } from "./format.ts"; import { assertEquals } from "./deps_test.ts"; Deno.test("patchTemplate()", async (t) => { await t.step("その1", () => { const headers = [ "header start", "header content", "", "header end", ]; const lines = [ "何か", "aaa", "header content", " コメントが書いてあるかも", "header end modified", "", "本文とか", "おしまい", "footer end", " ↑footerの残骸", ]; const footers = [ "footer start", "footer content", "footer end", ]; assertEquals(patchTemplate(lines, headers, footers), [ "header start", "header content", "", "header end", "", "何か", "aaa", "header content", " コメントが書いてあるかも", "header end modified", "", "本文とか", "おしまい", "footer end", " ↑footerの残骸", "", "footer start", "footer content", "footer end", ]); }); });